package com.zlkj.pro.modular.business.entity;

import com.baomidou.mybatisplus.annotation.*;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.*;

import java.time.LocalDate;
import java.util.Date;

/**
 * 客户
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "t_customer")
public class CustomerEntity extends Model<CustomerEntity> {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @TableField("name")
    private String name;

    @TableField("type")
    private Integer type;

    @TableField("classify")
    private String classify;

    @TableField("address")
    private String address;

    @TableField("address_province")
    private String addressProvince;
    @TableField("address_city")
    private String addressCity;
    @TableField("address_area")
    private String addressArea;

    @TableField("address_detail")
    private String addressDetail;

    @TableField("agent_id")
    private Long agentId;

    @TableField("level")
    private Integer level;

    @TableField("customer_status")
    private Integer customerStatus;

    @TableField("data_sort")
    private Integer dataSort;

    @TableField("remark")
    private String remark;

    // 个人用户手机
    @TableField("phone")
    private String phone;

    // 统一社会信用代码
    @TableField("uscc")
    private String uscc;

    // 最近成交日期
    @TableField("transaction_date")
    private LocalDate transactionDate;

    @TableField("status_flag")
    private Integer statusFlag;

    /**
     * 创建时间
     */
    @TableField(value = "create_time", fill = FieldFill.INSERT)
    private Date createTime;

    /**
     * 创建人
     */
    @TableField(value = "create_user", fill = FieldFill.INSERT)
    private Long createUser;

    /**
     * 更新时间
     */
    @TableField(value = "update_time", fill = FieldFill.UPDATE)
    private Date updateTime;

    /**
     * 更新人
     */
    @TableField(value = "update_user", fill = FieldFill.UPDATE)
    private Long updateUser;

    /**
     * 删除标记：Y-已删除，N-未删除
     */
    @TableLogic
    @TableField(value = "del_flag")
    private String delFlag;

    /**
     * 省份
     */
    @TableField(value = "province")
    private String province;

}